package cn.qqncn.furniture.mapper;

import cn.qqncn.furniture.pojo.domain.Furniture;
import cn.qqncn.furniture.pojo.vo.PieVo;
import cn.qqncn.furniture.pojo.vo.ShopVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface FurnitureMapper {
    int deleteByPrimaryKey(Integer furnitureId);

    int insert(Furniture record);

    int insertSelective(Furniture record);

    Furniture selectByPrimaryKey(Integer furnitureId);

    int updateByPrimaryKeySelective(Furniture record);

    int updateByPrimaryKey(Furniture record);

//    查询全部
    List<Furniture> selectAll();

//  模糊查询
    List<ShopVo> pageSelect(@Param("post_search") String post_search,
                            @Param("min") Integer min,
                            @Param("max") Integer max);

    //批量删除
    int deleteSelectFurniture(int[] id);

    //根据类别查询全部商品
    List<ShopVo> selectByCategoryId(Integer categoryId);

    //查询商品各种类别的数量
    List<PieVo> selectPieVo();
}